#include "level.h"
#include "ui_level.h"

level::level(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::level)
{
    ui->setupUi(this);
    this->setWindowIcon(QIcon(":/image/menu.jpeg"));    //设置界面的背景图片
}



level::~level()
{
    delete ui;
}

void level::on_pushButton_clicked()     //关闭当前页面，返回主界面
{
    this->close();
    mainwindow *ma1 = new mainwindow;
    ma1->show();
}

void level::on_pushButton_2_clicked()       //点击后进入游戏界面
{
    if(ui->listWidget->currentRow()>-1)
    {
    Begin b;
    this->close();
    b.show();
    b.cho=ui->listWidget->currentRow();
    b.choselevel();
    b.tim=0;
    b.exec();

    }
    else
    {
        QMessageBox::warning(this,"提示","请选择关卡！",QMessageBox::Ok);
    }

}
